import request from '@/utils/request'
import logger from '@/utils/logger'

/**
 * @description 列出等待处理的退货商品-分页
 */
export const fetchGoodsReturnList = async (data) => {
  try {
    const response = await request({
      url: '/dealer/pzMemberOrderM/getPzReturnGoodsPagesByDealerId',
      method: 'post',
      data,
    })
    return response
  } catch (error) {
    logger.error('获取退货商品列表失败', error)
    throw error
  }
}

/**
 * @description 审核退货的商品
 */
export const postCheckPzReturnGoodsByDealerId = async (data) => {
  try {
    const response = await request({
      url: '/dealer/pzMemberOrderM/checkPzReturnGoodsByDealerId',
      method: 'post',
      data,
    })
    return response
  } catch (error) {
    logger.error('审核退货商品失败', error)
    throw error
  }
}
